// Author	: damphat@gmail.com
// Created	: 01/12/2008

#pragma once
#include "vn/NetCommon.h"


NET_BEGIN

class SocketAddress {
public:
	SocketAddress(short family, int size = 32) {
		CHECK_ARG((size == 16) || (size == 32));
		*(short*)m_buf = family;
		m_size = size;
	}

	short GetFamily() const {
		return *(short*)m_buf;
	}

	Buf8 *GetBuffer() {
		return m_buf;
	}

	const Buf8 *GetBuffer() const {
		return m_buf;
	}

private:
	short	m_family;
	Buf8	m_buf[32];
	int		m_size;
};

NET_END
